<template>
    <div class="about">
        <!-- <h1>This is an about page</h1>
        <button @click="save">保存</button>
        <button @click="getList">请求</button> -->
        <button @click="get">get</button>
        <el-input-number ref="change" v-model="num" @change="handleChange"  label="描述文字"></el-input-number>
    </div>
</template>
<script>
import { constants } from "crypto";
import { test, testPost, saveUser, getUserList } from "../server/api_test.js";
import { Promise } from 'q';
export default {
    name: "about",
    data() {
        return {
             num: 1
        };
    },
    methods: {
        handleChange(value) {
            console.log(value);
        },
        get(){
            console.log(this.$refs.change)
        },
         async save() {
            try {
                // let result = await test();
                let resultP = await saveUser({
                  name:"13634323376",
                  password:'123456',
                  nikeName:'小猴子'
                })
                // console.log(result);
                console.log(resultP);
            } catch (error) {
                console.log(error );
            }
        },
        async getList(){
            try {
                // let result = await test();
                let resultP = await getUserList({name:'小猴子'})
                // console.log(result);
                console.log(resultP);
            } catch (error) {
                console.log(error );
            }
        }
    }
};
</script>

